package org.goldenport.g3.messages.cli

import scala.collection.JavaConversions._
import com.asamioffice.goldenport.util.OptionUtil.lift
import org.goldenport.g3.G3Command
import org.goldenport.g3.messages._

/**
 * @since   Sep. 27, 2010
 * @version Oct. 12, 2010
 * @author  ASAMI, Tomoharu
 */
object CliCommand {
  def apply(args: Traversable[Any]): CliCommand = {
    val as = args.map(_.toString).toList
    if (args.isEmpty) {
      new CliCommand("")
    } else {
      new CliCommand(as.head, as.tail, args.toList)
    }
  }
}

class CliCommand(
  uri: String,
  val params: List[String] = Nil,
  val request: List[Any] = Nil
) extends G3Command(uri)
